home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form SettingsFrm
- BackColor = &H00C0C0C0&
- BorderStyle = 1 'Fixed Single
- Caption = "Settings"
- ClipControls = 0 'False
- ControlBox = 0 'False
- Height = 3225
- Left = 3480
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 2475
- ScaleWidth = 4260
- Top = 1950
- Width = 4440
- Begin CheckBox PosCB
- BackColor = &H00C0C0C0&
- Caption = "Remember clock position"
- Height = 255
- Left = 420
- TabIndex = 6
- Top = 630
- Width = 2655
- End
- Begin CheckBox SaveCB
- BackColor = &H00C0C0C0&
- Caption = "Save Settings"
- Height = 255
- Left = 1410
- TabIndex = 5
- Top = 1470
- Value = 1 'Checked
- Width = 1575
- End
- Begin CommandButton CancelBut
- Caption = "Cancel"
- Height = 330
- Left = 2310
- TabIndex = 4
- Top = 1890
- Width = 1065
- End
- Begin CommandButton OkBut
- Caption = "Ok"
- Height = 330
- Left = 1050
- TabIndex = 3
- Top = 1890
- Width = 1065
- End
- Begin CheckBox AddResCB
- BackColor = &H00C0C0C0&
- Caption = "Show Resources"
- Height = 255
- Left = 2205
- TabIndex = 2
- Top = 1050
- Value = 1 'Checked
- Width = 1815
- End
- Begin CheckBox TitleBarCB
- BackColor = &H00C0C0C0&
- Caption = "Add time to active window title bar"
- Height = 255
- Left = 420
- TabIndex = 1
- Top = 225
- Width = 3375
- End
- Begin CheckBox OnTopCB
- BackColor = &H00C0C0C0&
- Caption = "Always on top"
- Height = 255
- Left = 420
- TabIndex = 0
- Top = 1050
- Value = 1 'Checked
- Width = 1575
- End
- Begin Menu QuitMenu
- Caption = "Quit "
- Begin Menu QuitSysClockItem
- Caption = "SysClock"
- End
- Begin Menu QuitWinItem
- Caption = "Windows..."
- End
- End
- 'Declare API call for exiting windows
- Declare Function ExitWindows Lib "User" (ByVal dwReserved As Long, ByVal wReturnCode As Integer) As Integer
- Sub CancelBut_Click ()
- Unload SettingsFrm
- End Sub
- Sub Form_Load ()
- 'Center the form on loading
- Left = (Screen.Width - Width) / 2
- Top = (Screen.Height - Height) / 2
- 'Set check boxes according to global flags set by .ini file
- If TitleBarFlag = True Then
- TitleBarCB.Value = 1
- Else
- TitleBarCB.Value = 0
- End If
- If OnTopFlag = True Then
- OnTopCB.Value = 1
- Else
- OnTopCB.Value = 0
- End If
- If AddResFlag = True Then
- AddResCB.Value = 1
- Else
- AddResCB.Value = 0
- End If
- End Sub
- Sub Form_Paint ()
- 'Add 3D form border
- 'Call BorderFrame(Screen.ActiveForm, 60, 60, Screen.ActiveForm.Height - 740, Screen.ActiveForm.Width - 160)
- Call BorderFrame(Screen.ActiveForm, 40, 50, 650, 70)
- 'Add 3D frames to controls
- Call Frame(Screen.ActiveForm, TitleBarCB, 1)
- Call Frame(Screen.ActiveForm, AddResCB, 1)
- Call Frame(Screen.ActiveForm, OnTopCB, 1)
- Call Frame(Screen.ActiveForm, SaveCB, 1)
- Call Frame(Screen.ActiveForm, PosCB, 1)
- End Sub
- Sub OkBut_Click ()
- '*****
- 'Use this sub to implement settings and save them to the .ini files
- '*****
- 'Implement settings into global flags
- If TitleBarCB.Value = 1 Then
- TitleBarFlag = True
- Else
- TitleBarFlag = False
- End If
- If AddResCB.Value = 1 Then
- AddResFlag = True
- 'Determine the percent of free resources using functions
- TFree = Min(GetFreeResources("User"), GetFreeResources("GDI"))
- ResStr$ = " " + Format$(TFree, "00") + "%"
- Else
- AddResFlag = False
- End If
- 'Reset time label caption to establish Label1 for sizing
- SysClockFrm!Label1.Caption = Format$(Now, "ddd m/d/yy hh:mm AM/PM") + ResStr$
- If OnTopCB.Value = 1 Then
- OnTopFlag = True
- Call SetStayOnTop(True)
- Else
- OnTopFlag = False
- Call SetStayOnTop(False)
- End If
- If PosCB.Value = 1 Then
- PosFlag = True
- 'Save the form's position
- Pos% = WritePrivateProfileString("Settings", "Position", Trim$(Str(SysClockFrm.Top)) + "," + Trim$(Str(SysClockFrm.Left)), "SysClock.ini")
- Else
- PosFlag = False
- End If
- 'Save the settings in SysClock.ini if save box checked
- If SaveCB.Value = 1 Then
- Setting% = WritePrivateProfileString("Settings", "Title Bar", Str(TitleBarFlag), "SysClock.ini")
- Setting% = WritePrivateProfileString("Settings", "Add Res", Str(AddResFlag), "SysClock.ini")
- Setting% = WritePrivateProfileString("Settings", "On Top", Str(OnTopFlag), "SysClock.ini")
- End If
- Unload SettingsFrm
- 'Reset the size of form by call in a refresh
- Call SetFrmSize
- SysClockFrm.Refresh
- End Sub
- Sub QuitSysClockItem_Click ()
- '*****
- 'This closes all forms
- '*****
- Unload SysClockFrm
- Unload SettingsFrm
- End Sub
- Sub QuitWinItem_Click ()
- If MsgBox("Are you sure you want to quit windows?", 33, "Quitting") = 1 Then
- Xit% = ExitWindows(0, 0) = 0
- End If
- End Sub
-